package remote.rmicase;

import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;

/**
 * description:
 * rmi远程服务端
 * @author Yuanml on 2020/10/29 16:02
 */
public class Server {
    public static void main(String[] args) throws RemoteException {
        System.out.println("start remote service...");
        //在1099端口开启注册
        LocateRegistry.createRegistry(1099);
        try {
            //绑定服务对象
            Naming.rebind("MyRemote",new MyRemoteImpl() );
        } catch (MalformedURLException e) {
            e.printStackTrace();
        }
    }
}